package tenant_db

import "time"

const (
	TenantCodeDisabled      = 20019997
	TenantCodeEmpty         = 20019998
	TenantCodeNotFound      = 20019999
	TenantCodeDBPasswordErr = 20019996
)

type Tenant struct {
	ID          string    `json:"id"`
	Code        string    `json:"code"`
	Name        string    `json:"name"`
	Email       string    `json:"email"`
	Enabled     int       `json:"enabled"`
	MasterName  string    `json:"master_name"`
	MasterPhone string    `json:"master_phone"`
	MasterEmail string    `json:"master_email"`
	Remark      string    `json:"remark"`
	CreatedBy   string    `json:"created_by"`
	CreatedOn   time.Time `json:"created_on"`
	ModifiedBy  string    `json:"modified_by"`
	ModifiedOn  time.Time `json:"modified_on"`
	IsDeleted   int       `json:"is_deleted"`
}

func (p Tenant) TableName() string {
	return "tenants"
}

type TenantInstance struct {
	Host       string
	Port       string
	DbName     string
	Username   string
	Password   string
	TenantCode string
}

func (p TenantInstance) TableName() string {
	return "tenants_instance"
}
